
<div id="post_new"></div>
<style>
#seccode,.fastpost_s{z-index:1000;}
#fastsmilies{z-index:1001}
.sec_code{padding:30px 15px;}

</style>
<div class="fastpost">

	<form method="post" name="fastpostform" autocomplete="off" id="fastpostform" action="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]&extra=$_GET[extra]&replysubmit=yes">
	<input type="hidden" name="formhash" value="{FORMHASH}" />	
		
	<div id="fastsmilies" >
    	<ul id="fastsmilies_k"></ul>
    	<div id="fastsmilies_v" style="display:block;"></div>
    </div>
    <div id="seccode" style=" display:none;">    
    	<!--{if $_G[forum_thread][special] == 5 && empty($firststand)}-->

		<select id="stand" name="stand" style=" margin:10px;">
			<option value="">{lang debate_viewpoint}</option>
			<option value="0">{lang debate_neutral}</option>
			<option value="1">{lang debate_square}</option>
			<option value="2">{lang debate_opponent}</option>
		</select>
		
		<!--{/if}-->
    
        <!--{if $secqaacheck || $seccodecheck}--><!--{subtemplate common/seccheck}--><!--{/if}-->
    </div>
	<div class="fastpost_s">   
    	<div class="fastpost_face">
        <a href="javascript:;"  onclick="fastsmilies();" id="post_face">
        <img src="{$_G['siteurl']}template/strong_ios7/touch/images/face.png" />
        
        </a>
        </div>    
        
        
        <div class="fastpost_button" id="fastpost_button" style="display:none;">
        	<input type="button" value="{lang reply}" class="button2" name="replysubmit" style="margin: 10px 3px;height: 32px;width: 50px;" id="fastpostsubmit">
        </div>
        
        <div class="fastpost_pic" id="fastpost_pic" >
        <a href="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]&reppost=$_G[forum_firstpid]&page=$page" id="post_camera">
        <img src="template/strong_ios7/touch/images/camera.png"  />
        </a>
        </div>    
		<div class="fastpost_input">
        	<input type="text" value="{lang send_reply_fast_tip}"  class="input grey" color="gray" name="message"  id="fastpostmessage"  onkeyup="strLenCalc(this);" >
          <script type="text/javascript">strLenCalc($('#fastpostmessage'))</script>
       </div> 
       
		<div id="fastpostsubmitlinea" style="display:none;" ><input type="button" value="{lang reply}" class="button2" name="replysubmit" id="fastpostsubmit"><a href="forum.php?mod=post&action=reply&fid=$_G[fid]&tid=$_G[tid]&reppost=$_G[forum_firstpid]&page=$page" class="y" style="height:30px;width:30px;margin-top:7px;background:url({STATICURL}image/mobile/images/icon_photo.png) no-repeat"><span class="none">{lang reply}</span></a><!--{hook/viewthread_fastpost_button_mobile}--></div>
        
	
	</div>
    </form>
</div>
<script>
function insertIcon(iconCode) {	

 var txtarea = document.fastpostform.message;
 iconCode = '' + iconCode + '';
 if (txtarea.createTextRange && txtarea.caretPos) {
 var caretPos = txtarea.caretPos;
 caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == '' ? iconCode + '' : iconCode;
 txtarea.focus(); 
 } else {
 txtarea.value += iconCode;
 txtarea.focus();

 }
}

function view_mcbox(){
	
	$("#fastsmilies,#seccode,#view_mcbox").hide();
	
	
	
	
	}
</script>
<script src="./data/cache/common_smilies_var.js" charset={CHARSET}></script>
<script src="./template/strong_ios7/touch/post.js" charset={CHARSET}></script>
<script type="text/javascript">

	function strLenCalc(obj) {
		if ($(obj).val() == ''){$("#fastpost_pic").show();$("#fastpost_button,#seccode").hide();$("#view_mcbox").hide();}else{$("#fastpost_button,#seccode").show();$("#fastpost_pic").hide();$("#view_mcbox").show();}
	
	}

	function fastsmilies(){		
		$('#fastsmilies').toggle();
		$("#view_mcbox").show();
			if($('#fastpostmessage').attr('value') == '{lang send_reply_fast_tip}') {				
				$('#fastpostmessage').attr('value', '');
				$('#fastpostmessage')[0].focus();
			}		
		
		}


	function fastpost(v){
		
		var actionurl = $("#fastpostform").attr('action')+'&repquote='+v;		
		$("#fastpostform").attr("action",actionurl); 
		}

	(function() {
		var form = $('#fastpostform');
		<!--{if !$_G[uid] || $_G[uid] && !$allowpostreply}-->
		$('#fastpostmessage').on('focus', function() {
			<!--{if !$_G[uid]}-->
				popup.open('{lang nologin_tip}', 'confirm', 'member.php?mod=logging&action=login');
			<!--{else}-->
				popup.open('{lang nopostreply}', 'alert');
			<!--{/if}-->
			this.blur();
		});
		<!--{else}-->
		$('#fastpostmessage').on('focus', function() {
			var obj = $(this);
			if(obj.attr('value') == '{lang send_reply_fast_tip}') {
				
				obj.attr('value', '');

			}
		})

		<!--{/if}-->
		$('#fastpostsubmit').on('click', function() {
			var msgobj = $('#fastpostmessage');
			if(msgobj.val() == '{lang send_reply_fast_tip}') {
				msgobj.attr('value', '');
			}
			$.ajax({
				type:'POST',
				url:form.attr('action') + '&handlekey=fastpost&loc=1&inajax=1',
				data:form.serialize(),
				dataType:'xml'
			})
			.success(function(s) {
				evalscript(s.lastChild.firstChild.nodeValue);
				$("#fastsmilies,#seccode").hide();
				
			})
			.error(function() {
				window.location.href = obj.attr('href');
				popup.close();
			});
			return false;
		});

		$('#replyid').on('click', function() {
			//$(document).scrollTop($(document).height());
			$('#fastpostmessage')[0].focus();
		});

	})();

	function succeedhandle_fastpost(locationhref, message, param) {
		var pid = param['pid'];
		var tid = param['tid'];
		if(pid) {
			$.ajax({
				type:'POST',
				url:'forum.php?mod=viewthread&tid=' + tid + '&viewpid=' + pid + '&mobile=2',
				dataType:'xml'
			})
			.success(function(s) {
				$('#post_new').append(s.lastChild.firstChild.nodeValue);
			})
			.error(function() {
				window.location.href = 'forum.php?mod=viewthread&tid=' + tid;
				popup.close();
			});
		} else {
			if(!message) {
				message = '{lang postreplyneedmod}';
			}
			popup.open(message, 'alert');
		}
		$('#fastpostmessage').attr('value', '');
		if(param['sechash']) {
			$('.seccodeimg').click();
		}
	}

	function errorhandle_fastpost(message, param) {
		popup.open(message, 'alert');
	}
</script>
